//获取应用实例
const app = getApp();
// 引入AES.js
var baseJs = require("../../common/base.js");
var WxParse = require('../../wxParse/wxParse.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    article: "",
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var that = this;
    var article = this.data.article;
    wx.request({
      url: baseJs.api + baseJs.encryUrl("method=GetUseProduce&smallTitleId=" + options.id),
      success: function (res) {
        var json = JSON.parse(baseJs.decryUrl(res.data)).ResultData;
        console.log(json);
        article = json.Describe;
        WxParse.wxParse('article', 'html', article, that, 5);

      }
    })
  },

  
  // GetUseProduce
  GetUseProduce: function() {
    var that = this;
    var id = this.data.id;
    var article = this.data.article;
    wx.request({
      url: baseJs.api + baseJs.encryUrl("method=GetUseProduce&smallTitleId=" + id),
      success: function(res) {
        var json = JSON.parse(baseJs.decryUrl(res.data)).ResultData;
        console.log(json);
        article = json.Describe;
        // describe = json.Describe.replace(/&nbsp;/g, "");
        // describe = json.Describe.replace(/<[^>]+>/g, "");
        that.setData({
          article: article
        })
        
      }
    })
  },
})